/*************************************************************
 * File: Gender.java
 * Copyright (c) 2012
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Mar 8, 2013
 * Description: 
 ************************************************************/

package snow.core.enums;

/**
 * 性别
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com
 * @version 1.0
 */
public enum Gender {

	MALE(Boolean.TRUE), FEMALE(Boolean.FALSE), SECRET(null);

	public static Gender toGenderFrom(Object value) {
		if (Boolean.TRUE.equals(value)) {
			return Gender.MALE;
		} else if (Boolean.FALSE.equals(value)) {
			return Gender.FEMALE;
		}
		return Gender.SECRET;
	}

	private final Boolean value;

	private Gender(Boolean value) {
		this.value = value;
	}

	public Boolean getValue() {
		return this.value;
	}
	
}
